package com.demo.annotation_a_ioc;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestAnnoIoc {
    //spring工厂
    @Test
    public void test2(){
        String xmlPath="com/demo/annotation_a_ioc/beans.xml";
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext(xmlPath);
        UserService userService=applicationContext.getBean("userService",UserService.class);
        userService.addUser();
    }
}
